	var userId = getQueryString("userId");
	
	function initInterface(){
		var str = "";
		$.ajax({
			url: API_URL+'manager/managerNumberQuery?staff_number='+userId,
			type: 'GET',
			dataType: "JSON",
			async: false,
			success: function (obj){ 
				if(obj.status.code==0){
					var myData = obj.data;
					for(var i=0;i<myData.length;i++){
						str+="<li><a onclick=\"showGroupsList('"+obj.data[i].groupsId+"')\" href='javascript:;'>"+obj.data[i].groupsName+"<i class='open'></i></a><ul class='open_list' id='"+obj.data[i].groupsId+"'></ul><input type='hidden' id='"+obj.data[i].groupsId+"hid' value='0'/></li>";
					}
					$(".open_lists").html(str);
				}
			},
			error: function(request){
				alert('错误');
			}
		});
	}
	
	function showGroupsList(groupsId){
		//alert('--->'+groupsId);
		var hidshow = $('#'+groupsId+'hid').val();
		//alert(hidshow);
		if(hidshow=='0'){
			$.ajax({
				url: API_URL+'manager/managerChart?groupsId='+groupsId,
				type: 'GET',
				dataType: "JSON",
				async: false,
				success: function (obj){ 
					
					var str = "";
					for(var i=0;i<obj.data.length;i++){
						/*
						//陪访 
						var peifang = (obj.data[i].coach>3?3:obj.data[i].coach);
						//九辅
						var jiufu = 0;
						if((obj.data[i].coach-3)<0){
						}else {
							jiufu = ((obj.data[i].coach-3)>9?9:(obj.data[i].coach-3));
						}
						//话术
						var huashu = 0;
						if((obj.data[i].customs-9)<0){
						}else {
							huashu = ((obj.data[i].customs-9)>9?9:(obj.data[i].customs-9));
						}
						*/
						
						//头像默认地址
						var icons = "";
						if(null == obj.data[i].icon || obj.data[i].icon==''){
							icons= "../img/default.png";
						}else{
							icons = obj.data[i].icon;
						}
						str +="<li class='record_list'><a href='finish_clearance.html?utype=1&userId="+obj.data[i].staff_number+"'><img src='"
						+icons+"' alt=''><h3 class='name'>"
						+obj.data[i].name+"</h3><h3>"
						+obj.data[i].grade+"</h3><div class='table_list'><div><span>"
						+"陪访</span><p class='tiao'><span style='width:"+(obj.data[i].peifang)/3*50+"px'></span></p><p class='num_content'><i class='cur'>"
						+obj.data[i].peifang+"</i>/<i class='sum'>3</i></p></div><div><span>辅导</span><p class='tiao'><span style='width:"+(obj.data[i].coach)/9*50+"px'></span></p><p class='num_content'><i class='cur'>"
						+obj.data[i].coach+"</i>/<i class='sum'>9</i></p></div><div><span>话术</span><p class='tiao'><span style='width:"+(obj.data[i].customs)/7*50+"px'></span></p><p class='num_content'><i class='cur'>"
						+obj.data[i].customs+"</i>/<i class='sum'>7</i></p></div></div><span class='into'></span></a></li>";
					}
					$("#"+groupsId+"").html(str);
					$('#'+groupsId+'hid').val("1");
				}
			})
		}else{
				
		}
	}